from ultralytics import YOLO

# 加载模型
model = YOLO("mask2.pt")

# 获取标签
labels = model.names
print("Labels:", labels)